﻿package game.socket {
	import flash.events.Event;
	
	public class SocketEvent extends Event {
		
		public static const CONNECTED:String		= "socket.connected";
		public static const DISCONNECTED:String		= "socket.disconnected";
		public static const ERROR:String			= "socket.error";
		public static const POLICY:String			= "socket.policy";
		
		public var socket:SocketConnection;
		
		public function SocketEvent($type:String, socket:SocketConnection, $bubbles:Boolean = false, $cancelable:Boolean = false) {
			super($type, $bubbles, $cancelable);
			this.socket = socket;
		}

		public override function toString():String {
			return formatToString("SocketEvent", "socket", "type", "bubbles", "cancelable");
		}
		
	}
}